home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13160 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.iadfw.net!usenet
  2. From: Mark Nelson <markn@airmail.net>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: DLL's & VB
  5. Date: Sat, 23 Mar 1996 20:17:35 -0600
  6. Organization: customer of Internet America
  7. Message-ID: <3154B0BF.5683@airmail.net>
  8. References: <4j26ov$ks0$1@mhafc.production.compuserve.com>
  9. NNTP-Posting-Host: dal12-09.ppp.iadfw.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0GoldB2 (Win95; I)
  14.  
  15. Ed Lopez wrote:
  16. > I want to create a DLL that may be used by a VB application.  I'm
  17. > using VC++ 1.5.  My question is can I write a CLASS that is
  18. > exported and access it from a VB(ver 3.0) program or can I only
  19. > use exported FUNCTIONS when dealing with VB.   Thanks Ed.
  20.  
  21. VB 3.0 doesn't really understand the concept of a C++ class.  I've used 
  22. C++ classes with VB by creating objects and returning pointers to them
  23. via 32 bit "handles."  My DLL knows that the handle is actually a pointer 
  24. to an object, but the VB program doesn't have to be aware of this.
  25.  
  26. Member functions are then invoked by calling exported C functions with the
  27. handle as a parameter.  Once inside the DLL, the handle is cast to the 
  28. appropriate pointer type and the member function can be called.
  29.  
  30. Mark Nelson
  31. http://web2.airmail.net/markn
  32.